<extend name="Base/common"/>
<block name="body">
    <div class="span9 page_message">
        <section id="contents">
            <include file="Addons/_nav"/>
            <div class="table-bar" style="height: 180px">
                <div class="fl">
                    <empty name="model.extend">
                        <div class="tools">
                            <form action="{:U('send_ewm')}" class="form-horizontal fl" method="post">
                                <p style="color: #D43F3A">快捷生成带参数（目前参数只支持1--100000）：</p> <br/>
                                <label>场景ID:</label>
                                <input name="ewmid" type="number" max="100000" min="1" id="ewmid" size="3"/>
                                <input type="hidden" name="id" value="{$data.id}" readonly>
                                <label>类型:</label>
                                <select name="type">
                                    <option value="QR_SCENE">临时二维码</option>
                                    <option value="QR_LIMIT_SCENE" selected>永久二维码</option>
                                </select>
                                <label>场景名:</label>
                                <input type="text" name="extra_text">
                                <br/>
                                <button type="submit" class="btn submit-btn " target-form="form-horizontal">生成二维码
                                </button>
                            </form>
                        </div>
                    </empty>
                </div>
                <!-- 高级搜索 -->

            </div>


            <!-- 数据列表 -->
            <div class="data-table">
                <div class=" table-striped">
                    <table cellpadding="0" cellspacing="1">
                        <!-- 表头 -->
                        <thead>
                        <tr>
                            <if condition="$check_all">
                                <th class="row-selected row-selected"><input class="check-all" type="checkbox"></th>
                            </if>
                            <volist name="list_grids" id="field">
                                <th>{$field.title}</th>
                            </volist>
                        </tr>
                        </thead>

                        <!-- 列表 -->
                        <tbody>
                        <volist name="list_data" id="data">
                            <tr>
                                <if condition="$check_all">
                                    <td><input class="ids" type="checkbox" value="{$data['id']}" name="ids[]"></td>
                                </if>
                                <volist name="list_grids" id="grid">
                                    <td>{:get_list_field($data,$grid,$model)}</td>
                                </volist>
                            </tr>
                        </volist>
                        </tbody>
                    </table>
                </div>
            </div>
            <div class="page" > {$_page|default=''}</div>
        </section>
    </div>
</block>
<block name="script">
    <!--<div style="position: absolute;left:30%;top:40%;z-index:99;height: 300px;width: 300px;background-color:rgba(0,0,0,0.5)">-->


    <!--</div>-->
    <script type="text/javascript">
        $(function () {
            $("img").click(function(){
              if($(this).attr('dataimg')=='Qimg'){
                  var alertmsag=$("#top-alert");
                  var content=$("#top-alert .alert-content");
                  var src=$(this).attr('src')
                  alertmsag.css({'height':'300px','text-align':'center','width':'230px'});
                  alertmsag.attr("class","top-alert-tips alert-success");
                  content.html("<img style='width:200px;height: 200px;margin-top: 30px' src='"+src+"'><br/><p style='font-size: 18px;color: #5D6A78'>请在图片右击另存二维码</p>");
                  alertmsag.show();
//                  alert($(this).attr('src'));
              }

            });
            //搜索功能
            $("#search").click(function () {
                var url = $(this).attr('url');
                var query = $('.search-form').find('input').serialize();
                query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
                query = query.replace(/^&/g, '');
                if (url.indexOf('?') > 0) {
                    url += '&' + query;
                } else {
                    url += '?' + query;
                }
                window.location.href = url;
            });

            //回车自动提交
            $('.search-form').find('input').keyup(function (event) {
                if (event.keyCode === 13) {
                    $("#search").click();
                }
            });

        })
    </script>
</block>
